<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/icon.css" />

<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
$(function () {
	$('#cc').combobox({    
	    url:'selectUser', 
	     valueField:'id',    
	 	 textField:'text'
	}); 
	$('#cc1').combobox({    
	    url:'selectRole',    
	    valueField:'id', 
	    textField:'text'    	
	}); 
	$('#btn').linkbutton({    
		onClick:function(){
			$('#myform').submit(); 
			
		}   
	});
	var UserName=$("#cc").combo('getText');
	var UserRole=$("#cc1").combo('getText');
	$("#myform").form({
		url:'updateRole',
		success:function(data){    
		       if(data=="1"){
		    	  location.href = "updateRole.jsp";
		    	   $.messager.show({
		    			title:'信息提示',
		    			msg:'角色更改成功!',
		    			timeout:1000,
		    			showType:'slide'
		    		});
		    	   $("#cc").val("");
			       $("#cc1").val("");
		       }
		     
		       else{
		    	   $.messager.show({
		    			title:'信息提示',
		    			msg:'角色更改失败！',
		    			timeout:1000,
		    			showType:'slide'
		    		});
		       } 
		    }    
	})
	
})

	
</script>
<body>
<div >
<form id="myform" method="post">
用户名<input id="cc" name="UserName" value="">
角色<input id="cc1" name="UserRole" value="">
<a id="btn" href="#" class="easyui-linkbutton">确定</a>
</form>
</div>
</body>
</html>